<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/WEB-INF/tld/tags.tld" prefix="t" %>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="style/main.css">
    <title>Admissions. Catalog admissions</title>
</head>
<body>
<table class="tableBody">
    <tr>
        <td colspan="3">
            <t:header/>
        </td>
    </tr>
    <tr style="vertical-align: top">
        <td>
            <t:menu roleUser="${sessionScope.userRole}"/></td>
        <td style="background: #2c6932; width: 2px"/>
        <td style="width: 900px">
            <form name="ordersListForm" action="controller" method="post">
                <table class="tableView">
                    <tr class="tableHeaderRow">
                        <td>№</td>
                        <td>Order №</td>
                        <td>Orders date</td>
                        <td>Name</td>
                        <td>Specialty</td>
                        <td>Group</td>
                        <td>Teaching form</td>
                        <td>Teaching plan</td>
                        <td>Language</td>
                        <td>Payment type</td>
                        <td>isAdopted</td>
                        <td>Select</td>
                    </tr>
                    <c:set var="number" value="1"/>
                    <c:forEach var="order" items="${requestScope.orders}">
                        <tr>
                            <td>${number}</td>
                            <td>${order.id}</td>
                            <td>${order.orderDate}</td>
                            <td>${order.lastname} ${order.firstname} ${order.middlename}</td>
                            <td>${order.specialty.code}-${order.specialty.name}</td>
                            <td>${order.group}</td>
                            <td>${order.teachingForm.form}</td>
                            <td>${order.teachingPlan.planName}</td>
                            <td>${order.language}</td>
                            <td>${order.paymentType}</td>
                            <td>
                                <c:if test="${order.adopted}">
                                    <input type="checkbox" value="${order.adopted}" checked disabled style=""/>
                                </c:if>
                                <c:if test="${order.adopted eq 'false'}">
                                    <input type="checkbox" value="${order.adopted}" disabled/>
                                </c:if>
                            </td>
                            <td><input type="radio" value="${order.id}" name="radio"/></td>
                        </tr>
                        <c:set var="number" value="${number+1}"/>
                    </c:forEach>
                    <tr>
                        <td colspan="8" style="text-align: left">
                            <input type="hidden" name="action" value="orderView">
                            <input type="submit" value="View" name="submit" class="commandButton">
                        </td>
                    </tr>
                </table>
            </form>
        </td>
    </tr>
    <tr>
        <td colspan="3">
            <t:footer/>
        </td>
    </tr>
</table>
</body>
</html>